package org.budo.support.jedis.util;

import org.budo.support.slf4j.Slf4j;
import org.slf4j.Logger;

import redis.clients.jedis.Jedis;

/**
 * @author li
 * @version 1 (2015年3月27日 下午4:05:02)
 * @since Java7
 */
public class JedisUtil {
    private static final Logger log = Slf4j.getLogger();

    public static void close(Jedis jedis) {
        try {
            if (null == jedis) {
                return;
            }

            jedis.quit();
            jedis.disconnect();
            jedis.close();

            jedis = null;
        } catch (Throwable e) {
            log.error("#26 close Jedis error, e=" + e, e);
        }
    }
}